package com.java.wysnstudy.cc;

import java.util.Arrays;

public class Test0113 {
    /**
     * 922. 按奇偶排序数组 II
     *
     */
    void method(){
        int[] arr = new int[]{3,1,4,2};
        for (int i = 0; i < arr.length; i++) {
            for (int j = i; j < arr.length; j++) {
                int k=arr[j];
                if (k%2 ==i%2){
                    arr[j]=arr[i];
                    arr[i]=k;
                    break;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main(String[] args) {
        int a=20;
        int b=19;

        a=a^b;
        System.out.println(a);
        b=a^b;
        System.out.println(b);

    }
}
